<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Group - p5.play</title>
    <link rel="stylesheet" href="">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="stylesheet" href="../assets/css/custom.css">
    <link rel="stylesheet" href="../assets/css/lucid.css">
    <link rel="stylesheet" href="../assets/vendor/bootstrap/css/bootstrap.css">
    <link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
</head>
<body class="yui3-skin-sam">
<div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
        <h1 class="brand" style="padding: 10px 16px 10px; height: 20px; line-height: 20px; margin-left: 0;">
	    <img alt="p5.play" src="../../asterisk.png" style="max-height: 65%;" title="p5.play">
            p5.play
        </h1>
	<div class="nav">
            <li class="divider-vertical"></li>
            <li>
                <p class="navbar-text">
                    API Docs for Version: <b>1.0.0</b>
                </p>
            </li>
        </div>
        <form class="navbar-form pull-right" style="line-height: 40px; height: 40px;">
            <input style="margin-top: 0;" type="text" class="search-query" placeholder="Search for classes/modules..." data-obj='["classes/Animation", "classes/Camera", "classes/Group", "classes/p5.play", "classes/Sprite", "modules/p5.play"]'>
        </form>
    </div>
</div>
<div class="container">
    <div class="row">
        <div class="span3">
	    <div>
	        <div id="sidebar">
	        <div id="classes">
	            <ul id="api-classes" class="nav nav-list">
	                    <li><a href="../classes/Animation.html">Animation</a></li>
	                    <li><a href="../classes/Camera.html">Camera</a></li>
	                    <li><a href="../classes/Group.html">Group</a></li>
	                    <li><a href="../classes/p5.play.html">p5.play</a></li>
	                    <li><a href="../classes/Sprite.html">Sprite</a></li>
	            </ul>
	        </div>
	        </div>
	    </div>
        </div>
        <div class="span9">
                <form id="options-form" class="form-inline pull-right">
                    Show:
                    <label for="api-show-inherited" class="checkbox">
                        <input type="checkbox" id="api-show-inherited" checked>
                        Inherited
                    </label>
            
                    <label for="api-show-protected" class="checkbox">
                        <input type="checkbox" id="api-show-protected">
                        Protected
                    </label>
            
                    <label for="api-show-private" class="checkbox">
                        <input type="checkbox" id="api-show-private">
                        Private
                    </label>
                    <label for="api-show-deprecated" class="checkbox">
                        <input type="checkbox" id="api-show-deprecated">
                        Deprecated
                    </label>
            
                </form>
            
            <div class="apidocs">
                <div id="docs-main">
                    <div class="content">
                        <div class="page-header">
                            <h1>Group</h1>
                        </div>
                        
                        
                        
                        	<div class="well well-small">
                                    Module: <a href="../modules/p5.play.html">p5.play</a><br>
                                    Parent Module: <a href="../modules/p5.play.html">p5.play</a>
                            </div>
                        
                        
                        
                        <div class="yuidoc-class-description">
                        <p>In p5.play groups are collections of sprites with similar behavior.
                        For example a group may contain all the sprites in the background
                        or all the sprites that "kill" the player.</p>
                        <p>Groups are "extended" arrays and inherit all their properties
                        e.g. group.length</p>
                        <p>Since groups contain only references, a sprite can be in multiple
                        groups and deleting a group doesn't affect the sprites themselves.</p>
                        <p>Sprite.remove() will also remove the sprite from all the groups
                        it belongs to.</p>
                        
                        </div>
                        
                        <!-- table of contents -->
                        
                        <div id="class-toc" class="page-section">
                        	<h2>Table of Contents</h2>
                            <ul>
                        		<li>
                        			<strong>Methods</strong>
                        			<ul>
                        				<li><a href="#method-add"><span class="im">add</span>(<span class="ia">sprite</span>)</a></li>
                        				<li><a href="#method-bounce"><span class="im">bounce</span>(<span class="ia">target</span><span class="ia">callback</span>)</a></li>
                        				<li><a href="#method-clear"><span class="im">clear</span>()</a></li>
                        				<li><a href="#method-clear"><span class="im">clear</span>()</a></li>
                        				<li><a href="#method-contains"><span class="im">contains</span>(<span class="ia">sprite</span>)</a></li>
                        				<li><a href="#method-displace"><span class="im">displace</span>(<span class="ia">target</span><span class="ia">callback</span>)</a></li>
                        				<li><a href="#method-draw"><span class="im">draw</span>()</a></li>
                        				<li><a href="#method-get"><span class="im">get</span>(<span class="ia">i</span>)</a></li>
                        				<li><a href="#method-maxDepth"><span class="im">maxDepth</span>()</a></li>
                        				<li><a href="#method-minDepth"><span class="im">minDepth</span>()</a></li>
                        				<li><a href="#method-overlap"><span class="im">overlap</span>(<span class="ia">target</span><span class="ia">callback</span>)</a></li>
                        				<li><a href="#method-overlap"><span class="im">overlap</span>(<span class="ia">target</span><span class="ia">callback</span>)</a></li>
                        				<li><a href="#method-remove"><span class="im">remove</span>(<span class="ia">sprite</span>)</a></li>
                        			</ul>
                        		</li>
                        
                        
                        
                        	</ul>
                        </div>
                        
                        <!-- details -->
                        
                            <div class="constructor yuidoc-class-constructor page-section">
                                <h2>Constructor</h2>
                                <div class="item-list">
                                <div id="method-Group" class="method item">
                                	<div class="method-signature">
                                	<span class="name"><code>Group</code></span>
                                
                                		<span class="paren">()</span>
                                	</div>
                                
                                
                                
                                
                                
                                
                                	<div class="meta">
                                				<p>
                                				Defined in
                                		<a href="../files/lib_p5.play.js.html#l2290"><code>lib&#x2F;p5.play.js:2290</code></a>
                                		</p>
                                
                                
                                
                                	</div>
                                
                                
                                
                                
                                </div>
                                </div>
                            </div>
                        
                            <div id="methods" class="page-section">
                                <h2 class="off-left">Methods</h2>
                                <div class="item-list">
                                    <div id="method-add" class="method item">
                                    	<div class="method-signature">
                                    	<span class="name"><code>add</code></span>
                                    
                                    		<div class="args">
                                    			<span class="paren">(</span><ul class="args-list inline commas">
                                    				<li class="arg">
                                    						<code>sprite</code>
                                    				</li>
                                    			</ul><span class="paren">)</span>
                                    		</div>
                                    	</div>
                                    
                                    
                                    
                                    
                                    
                                    
                                    	<div class="meta">
                                    				<p>
                                    				Defined in
                                    		<a href="../files/lib_p5.play.js.html#l2345"><code>lib&#x2F;p5.play.js:2345</code></a>
                                    		</p>
                                    
                                    
                                    
                                    	</div>
                                    
                                    	<div class="description"><p>Adds a sprite to the group.</p>
                                    </div>
                                    
                                    		<div class="params">
                                    			<h4>Parameters:</h4>
                                    
                                    			<ul class="params-list">
                                    				<li class="param">
                                    						<code class="param-name">sprite</code>
                                    						<span class="type"><a href="../classes/Sprite.html" class="crosslink">Sprite</a></span>
                                    
                                    
                                    					<div class="param-description"><p>The sprite to be added</p>
                                    </div>
                                    
                                    				</li>
                                    			</ul>
                                    		</div>
                                    
                                    
                                    </div>
                                    <div id="method-bounce" class="method item">
                                    	<div class="method-signature">
                                    	<span class="name"><code>bounce</code></span>
                                    
                                    		<div class="args">
                                    			<span class="paren">(</span><ul class="args-list inline commas">
                                    				<li class="arg">
                                    						<code>target</code>
                                    				</li>
                                    				<li class="arg">
                                    						<code class="optional">callback</code>
                                    				</li>
                                    			</ul><span class="paren">)</span>
                                    		</div>
                                    		<span class="returns-inline">
                                    			<span class="type">Boolean</span>
                                    		</span>
                                    	</div>
                                    
                                    
                                    
                                    
                                    
                                    
                                    	<div class="meta">
                                    				<p>
                                    				Defined in
                                    		<a href="../files/lib_p5.play.js.html#l2601"><code>lib&#x2F;p5.play.js:2601</code></a>
                                    		</p>
                                    
                                    
                                    
                                    	</div>
                                    
                                    	<div class="description"><p>Checks if the the group is overlapping another group.
                                    If the overlap is positive the sprites will bounce affecting each
                                    other's trajectories depending on their .velocity, .mass and .restitution</p>
                                    <p>The check is performed using the colliders. If colliders are not set
                                    they will be created automatically from the image/animation bounding box.</p>
                                    <p>A callback function can be specified to perform additional operations
                                    when the overlap occours.
                                    The function will be called for each single sprite overlapping.
                                    The parameter of the function are respectively the
                                    member of the current group and the member of the group passed as parameter.</p>
                                    </div>
                                    
                                    		<div class="params">
                                    			<h4>Parameters:</h4>
                                    
                                    			<ul class="params-list">
                                    				<li class="param">
                                    						<code class="param-name">target</code>
                                    						<span class="type">Object</span>
                                    
                                    
                                    					<div class="param-description"><p>Group to check against the current one</p>
                                    </div>
                                    
                                    				</li>
                                    				<li class="param">
                                    						<code class="param-name optional">[callback]</code>
                                    						<span class="type">Function</span>
                                    						<span class="flag optional" title="This parameter is optional.">optional</span>
                                    
                                    
                                    					<div class="param-description"><p>The function to be called if overlap is positive</p>
                                    </div>
                                    
                                    				</li>
                                    			</ul>
                                    		</div>
                                    
                                    		<div class="returns">
                                    			<h4>Returns:</h4>
                                    
                                    			<div class="returns-description">
                                    						<span class="type">Boolean</span>:
                                    					<p>True if overlapping</p>
                                    
                                    			</div>
                                    		</div>
                                    
                                    		<div class="example">
                                    			<h4>Example:</h4>
                                    
                                    			<div class="example-content">
                                    				<p><code>
                                    sprite.bounce(otherSprite, explosion);</p>
                                    <p>function explosion(spriteA, spriteB) {
                                    spriteA.remove();
                                    spriteB.score++;
                                    }
                                    </code></p>
                                    
                                    			</div>
                                    		</div>
                                    </div>
                                    <div id="method-clear" class="method item">
                                    	<div class="method-signature">
                                    	<span class="name"><code>clear</code></span>
                                    
                                    		<span class="paren">()</span>
                                    	</div>
                                    
                                    
                                    
                                    
                                    
                                    
                                    	<div class="meta">
                                    				<p>
                                    				Defined in
                                    		<a href="../files/lib_p5.play.js.html#l2371"><code>lib&#x2F;p5.play.js:2371</code></a>
                                    		</p>
                                    
                                    
                                    
                                    	</div>
                                    
                                    	<div class="description"><p>Removes all the sprites in the group
                                    from the scene.</p>
                                    </div>
                                    
                                    
                                    
                                    </div>
                                    <div id="method-clear" class="method item">
                                    	<div class="method-signature">
                                    	<span class="name"><code>clear</code></span>
                                    
                                    		<span class="paren">()</span>
                                    	</div>
                                    
                                    
                                    
                                    
                                    
                                    
                                    	<div class="meta">
                                    				<p>
                                    				Defined in
                                    		<a href="../files/lib_p5.play.js.html#l2385"><code>lib&#x2F;p5.play.js:2385</code></a>
                                    		</p>
                                    
                                    
                                    
                                    	</div>
                                    
                                    	<div class="description"><p>Removes all references to the group.
                                    Does not remove the actual sprites.</p>
                                    </div>
                                    
                                    
                                    
                                    </div>
                                    <div id="method-contains" class="method item">
                                    	<div class="method-signature">
                                    	<span class="name"><code>contains</code></span>
                                    
                                    		<div class="args">
                                    			<span class="paren">(</span><ul class="args-list inline commas">
                                    				<li class="arg">
                                    						<code>sprite</code>
                                    				</li>
                                    			</ul><span class="paren">)</span>
                                    		</div>
                                    		<span class="returns-inline">
                                    			<span class="type">Number</span>
                                    		</span>
                                    	</div>
                                    
                                    
                                    
                                    
                                    
                                    
                                    	<div class="meta">
                                    				<p>
                                    				Defined in
                                    		<a href="../files/lib_p5.play.js.html#l2322"><code>lib&#x2F;p5.play.js:2322</code></a>
                                    		</p>
                                    
                                    
                                    
                                    	</div>
                                    
                                    	<div class="description"><p>Checks if the group contains a sprite.</p>
                                    </div>
                                    
                                    		<div class="params">
                                    			<h4>Parameters:</h4>
                                    
                                    			<ul class="params-list">
                                    				<li class="param">
                                    						<code class="param-name">sprite</code>
                                    						<span class="type"><a href="../classes/Sprite.html" class="crosslink">Sprite</a></span>
                                    
                                    
                                    					<div class="param-description"><p>The sprite to search</p>
                                    </div>
                                    
                                    				</li>
                                    			</ul>
                                    		</div>
                                    
                                    		<div class="returns">
                                    			<h4>Returns:</h4>
                                    
                                    			<div class="returns-description">
                                    						<span class="type">Number</span>:
                                    					<p>Index or -1 if not found</p>
                                    
                                    			</div>
                                    		</div>
                                    
                                    </div>
                                    <div id="method-displace" class="method item">
                                    	<div class="method-signature">
                                    	<span class="name"><code>displace</code></span>
                                    
                                    		<div class="args">
                                    			<span class="paren">(</span><ul class="args-list inline commas">
                                    				<li class="arg">
                                    						<code>target</code>
                                    				</li>
                                    				<li class="arg">
                                    						<code class="optional">callback</code>
                                    				</li>
                                    			</ul><span class="paren">)</span>
                                    		</div>
                                    		<span class="returns-inline">
                                    			<span class="type">Boolean</span>
                                    		</span>
                                    	</div>
                                    
                                    
                                    
                                    
                                    
                                    
                                    	<div class="meta">
                                    				<p>
                                    				Defined in
                                    		<a href="../files/lib_p5.play.js.html#l2567"><code>lib&#x2F;p5.play.js:2567</code></a>
                                    		</p>
                                    
                                    
                                    
                                    	</div>
                                    
                                    	<div class="description"><p>Checks if the the group is overlapping another group.
                                    If the overlap is positive the sprites in the group will displace
                                    the colliding ones to the closest non-overlapping positions.</p>
                                    <p>The check is performed using the colliders. If colliders are not set
                                    they will be created automatically from the image/animation bounding box.</p>
                                    <p>A callback function can be specified to perform additional operations
                                    when the overlap occours.
                                    The function will be called for each single sprite overlapping.
                                    The parameter of the function are respectively the
                                    member of the current group and the member of the group passed as parameter.</p>
                                    </div>
                                    
                                    		<div class="params">
                                    			<h4>Parameters:</h4>
                                    
                                    			<ul class="params-list">
                                    				<li class="param">
                                    						<code class="param-name">target</code>
                                    						<span class="type">Object</span>
                                    
                                    
                                    					<div class="param-description"><p>Group to check against the current one</p>
                                    </div>
                                    
                                    				</li>
                                    				<li class="param">
                                    						<code class="param-name optional">[callback]</code>
                                    						<span class="type">Function</span>
                                    						<span class="flag optional" title="This parameter is optional.">optional</span>
                                    
                                    
                                    					<div class="param-description"><p>The function to be called if overlap is positive</p>
                                    </div>
                                    
                                    				</li>
                                    			</ul>
                                    		</div>
                                    
                                    		<div class="returns">
                                    			<h4>Returns:</h4>
                                    
                                    			<div class="returns-description">
                                    						<span class="type">Boolean</span>:
                                    					<p>True if overlapping</p>
                                    
                                    			</div>
                                    		</div>
                                    
                                    		<div class="example">
                                    			<h4>Example:</h4>
                                    
                                    			<div class="example-content">
                                    				<p><code>
                                    sprite.displace(otherSprite, explosion);</p>
                                    <p>function explosion(spriteA, spriteB) {
                                    spriteA.remove();
                                    spriteB.score++;
                                    }
                                    </code></p>
                                    
                                    			</div>
                                    		</div>
                                    </div>
                                    <div id="method-draw" class="method item">
                                    	<div class="method-signature">
                                    	<span class="name"><code>draw</code></span>
                                    
                                    		<span class="paren">()</span>
                                    	</div>
                                    
                                    
                                    
                                    
                                    
                                    
                                    	<div class="meta">
                                    				<p>
                                    				Defined in
                                    		<a href="../files/lib_p5.play.js.html#l2465"><code>lib&#x2F;p5.play.js:2465</code></a>
                                    		</p>
                                    
                                    
                                    
                                    	</div>
                                    
                                    	<div class="description"><p>Draws all the sprites in the group.</p>
                                    </div>
                                    
                                    
                                    
                                    </div>
                                    <div id="method-get" class="method item">
                                    	<div class="method-signature">
                                    	<span class="name"><code>get</code></span>
                                    
                                    		<div class="args">
                                    			<span class="paren">(</span><ul class="args-list inline commas">
                                    				<li class="arg">
                                    						<code>i</code>
                                    				</li>
                                    			</ul><span class="paren">)</span>
                                    		</div>
                                    	</div>
                                    
                                    
                                    
                                    
                                    
                                    
                                    	<div class="meta">
                                    				<p>
                                    				Defined in
                                    		<a href="../files/lib_p5.play.js.html#l2312"><code>lib&#x2F;p5.play.js:2312</code></a>
                                    		</p>
                                    
                                    
                                    
                                    	</div>
                                    
                                    	<div class="description"><p>Gets the member at index i.</p>
                                    </div>
                                    
                                    		<div class="params">
                                    			<h4>Parameters:</h4>
                                    
                                    			<ul class="params-list">
                                    				<li class="param">
                                    						<code class="param-name">i</code>
                                    						<span class="type">Number</span>
                                    
                                    
                                    					<div class="param-description"><p>The index of the object to retrieve</p>
                                    </div>
                                    
                                    				</li>
                                    			</ul>
                                    		</div>
                                    
                                    
                                    </div>
                                    <div id="method-maxDepth" class="method item">
                                    	<div class="method-signature">
                                    	<span class="name"><code>maxDepth</code></span>
                                    
                                    		<span class="paren">()</span>
                                    		<span class="returns-inline">
                                    			<span class="type">Number</span>
                                    		</span>
                                    	</div>
                                    
                                    
                                    
                                    
                                    
                                    
                                    	<div class="meta">
                                    				<p>
                                    				Defined in
                                    		<a href="../files/lib_p5.play.js.html#l2423"><code>lib&#x2F;p5.play.js:2423</code></a>
                                    		</p>
                                    
                                    
                                    
                                    	</div>
                                    
                                    	<div class="description"><p>Returns the highest depth in a group</p>
                                    </div>
                                    
                                    
                                    		<div class="returns">
                                    			<h4>Returns:</h4>
                                    
                                    			<div class="returns-description">
                                    						<span class="type">Number</span>:
                                    					<p>The depth of the sprite drawn on the top</p>
                                    
                                    			</div>
                                    		</div>
                                    
                                    </div>
                                    <div id="method-minDepth" class="method item">
                                    	<div class="method-signature">
                                    	<span class="name"><code>minDepth</code></span>
                                    
                                    		<span class="paren">()</span>
                                    		<span class="returns-inline">
                                    			<span class="type">Number</span>
                                    		</span>
                                    	</div>
                                    
                                    
                                    
                                    
                                    
                                    
                                    	<div class="meta">
                                    				<p>
                                    				Defined in
                                    		<a href="../files/lib_p5.play.js.html#l2444"><code>lib&#x2F;p5.play.js:2444</code></a>
                                    		</p>
                                    
                                    
                                    
                                    	</div>
                                    
                                    	<div class="description"><p>Returns the lowest depth in a group</p>
                                    </div>
                                    
                                    
                                    		<div class="returns">
                                    			<h4>Returns:</h4>
                                    
                                    			<div class="returns-description">
                                    						<span class="type">Number</span>:
                                    					<p>The depth of the sprite drawn on the bottom</p>
                                    
                                    			</div>
                                    		</div>
                                    
                                    </div>
                                    <div id="method-overlap" class="method item">
                                    	<div class="method-signature">
                                    	<span class="name"><code>overlap</code></span>
                                    
                                    		<div class="args">
                                    			<span class="paren">(</span><ul class="args-list inline commas">
                                    				<li class="arg">
                                    						<code>target</code>
                                    				</li>
                                    				<li class="arg">
                                    						<code class="optional">callback</code>
                                    				</li>
                                    			</ul><span class="paren">)</span>
                                    		</div>
                                    		<span class="returns-inline">
                                    			<span class="type">Boolean</span>
                                    		</span>
                                    	</div>
                                    
                                    
                                    
                                    
                                    
                                    
                                    	<div class="meta">
                                    				<p>
                                    				Defined in
                                    		<a href="../files/lib_p5.play.js.html#l2501"><code>lib&#x2F;p5.play.js:2501</code></a>
                                    		</p>
                                    
                                    
                                    
                                    	</div>
                                    
                                    	<div class="description"><p>Checks if the the group is overlapping another group.
                                    The check is performed using the colliders. If colliders are not set
                                    they will be created automatically from the image/animation bounding box.</p>
                                    <p>A callback function can be specified to perform additional operations
                                    when the overlap occours.
                                    The function will be called for each single sprite overlapping.
                                    The parameter of the function are respectively the
                                    member of the current group and the member of the group passed as parameter.</p>
                                    </div>
                                    
                                    		<div class="params">
                                    			<h4>Parameters:</h4>
                                    
                                    			<ul class="params-list">
                                    				<li class="param">
                                    						<code class="param-name">target</code>
                                    						<span class="type">Object</span>
                                    
                                    
                                    					<div class="param-description"><p>Group to check against the current one</p>
                                    </div>
                                    
                                    				</li>
                                    				<li class="param">
                                    						<code class="param-name optional">[callback]</code>
                                    						<span class="type">Function</span>
                                    						<span class="flag optional" title="This parameter is optional.">optional</span>
                                    
                                    
                                    					<div class="param-description"><p>The function to be called if overlap is positive</p>
                                    </div>
                                    
                                    				</li>
                                    			</ul>
                                    		</div>
                                    
                                    		<div class="returns">
                                    			<h4>Returns:</h4>
                                    
                                    			<div class="returns-description">
                                    						<span class="type">Boolean</span>:
                                    					<p>True if overlapping</p>
                                    
                                    			</div>
                                    		</div>
                                    
                                    		<div class="example">
                                    			<h4>Example:</h4>
                                    
                                    			<div class="example-content">
                                    				<p><code>
                                    sprite.overlap(otherSprite, explosion);</p>
                                    <p>function explosion(spriteA, spriteB) {
                                    spriteA.remove();
                                    spriteB.score++;
                                    }
                                    </code></p>
                                    
                                    			</div>
                                    		</div>
                                    </div>
                                    <div id="method-overlap" class="method item">
                                    	<div class="method-signature">
                                    	<span class="name"><code>overlap</code></span>
                                    
                                    		<div class="args">
                                    			<span class="paren">(</span><ul class="args-list inline commas">
                                    				<li class="arg">
                                    						<code>target</code>
                                    				</li>
                                    				<li class="arg">
                                    						<code class="optional">callback</code>
                                    				</li>
                                    			</ul><span class="paren">)</span>
                                    		</div>
                                    		<span class="returns-inline">
                                    			<span class="type">Boolean</span>
                                    		</span>
                                    	</div>
                                    
                                    
                                    
                                    
                                    
                                    
                                    	<div class="meta">
                                    				<p>
                                    				Defined in
                                    		<a href="../files/lib_p5.play.js.html#l2533"><code>lib&#x2F;p5.play.js:2533</code></a>
                                    		</p>
                                    
                                    
                                    
                                    	</div>
                                    
                                    	<div class="description"><p>Checks if the the group is overlapping another group.
                                    If the overlap is positive the sprites in the group will be displaced
                                    by the colliding one to the closest non-overlapping positions.</p>
                                    <p>The check is performed using the colliders. If colliders are not set
                                    they will be created automatically from the image/animation bounding box.</p>
                                    <p>A callback function can be specified to perform additional operations
                                    when the overlap occours.
                                    The function will be called for each single sprite overlapping.
                                    The parameter of the function are respectively the
                                    member of the current group and the member of the group passed as parameter.</p>
                                    </div>
                                    
                                    		<div class="params">
                                    			<h4>Parameters:</h4>
                                    
                                    			<ul class="params-list">
                                    				<li class="param">
                                    						<code class="param-name">target</code>
                                    						<span class="type">Object</span>
                                    
                                    
                                    					<div class="param-description"><p>Group to check against the current one</p>
                                    </div>
                                    
                                    				</li>
                                    				<li class="param">
                                    						<code class="param-name optional">[callback]</code>
                                    						<span class="type">Function</span>
                                    						<span class="flag optional" title="This parameter is optional.">optional</span>
                                    
                                    
                                    					<div class="param-description"><p>The function to be called if overlap is positive</p>
                                    </div>
                                    
                                    				</li>
                                    			</ul>
                                    		</div>
                                    
                                    		<div class="returns">
                                    			<h4>Returns:</h4>
                                    
                                    			<div class="returns-description">
                                    						<span class="type">Boolean</span>:
                                    					<p>True if overlapping</p>
                                    
                                    			</div>
                                    		</div>
                                    
                                    		<div class="example">
                                    			<h4>Example:</h4>
                                    
                                    			<div class="example-content">
                                    				<p><code>
                                    sprite.overlap(otherSprite, explosion);</p>
                                    <p>function explosion(spriteA, spriteB) {
                                    spriteA.remove();
                                    spriteB.score++;
                                    }
                                    </code></p>
                                    
                                    			</div>
                                    		</div>
                                    </div>
                                    <div id="method-remove" class="method item">
                                    	<div class="method-signature">
                                    	<span class="name"><code>remove</code></span>
                                    
                                    		<div class="args">
                                    			<span class="paren">(</span><ul class="args-list inline commas">
                                    				<li class="arg">
                                    						<code>sprite</code>
                                    				</li>
                                    			</ul><span class="paren">)</span>
                                    		</div>
                                    		<span class="returns-inline">
                                    			<span class="type">Boolean</span>
                                    		</span>
                                    	</div>
                                    
                                    
                                    
                                    
                                    
                                    
                                    	<div class="meta">
                                    				<p>
                                    				Defined in
                                    		<a href="../files/lib_p5.play.js.html#l2395"><code>lib&#x2F;p5.play.js:2395</code></a>
                                    		</p>
                                    
                                    
                                    
                                    	</div>
                                    
                                    	<div class="description"><p>Removes a sprite from the group.
                                    Does not remove the actual sprite, only the affiliation (reference).</p>
                                    </div>
                                    
                                    		<div class="params">
                                    			<h4>Parameters:</h4>
                                    
                                    			<ul class="params-list">
                                    				<li class="param">
                                    						<code class="param-name">sprite</code>
                                    						<span class="type"><a href="../classes/Sprite.html" class="crosslink">Sprite</a></span>
                                    
                                    
                                    					<div class="param-description"><p>The sprite to be removed</p>
                                    </div>
                                    
                                    				</li>
                                    			</ul>
                                    		</div>
                                    
                                    		<div class="returns">
                                    			<h4>Returns:</h4>
                                    
                                    			<div class="returns-description">
                                    						<span class="type">Boolean</span>:
                                    					<p>True if sprite was found and removed</p>
                                    
                                    			</div>
                                    		</div>
                                    
                                    </div>
                                </div>
                            </div>
                        
                        
                        
                        
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/vendor/jquery/jquery-1.8.2.min.js"></script>
<script src="../assets/vendor/bootstrap/js/bootstrap.js"></script>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script src="../assets/js/yuidoc-bootstrap.js"></script>
<script>prettyPrint();</script>
</body>
</html>
